🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / ui / src / commonMain / kotlin / org / meshtastic / core / ui / component / MeshtasticSnackbarHost.kt
Displaying Raw • Download
core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/MeshtasticSnackbarHost.kt 520fa717a938fd84682403b41f57d9f7e1ef49ef (520fa717) Text, 2.46 KB
T8b949e/*
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.ui.component
Tff7b72import T7ee787androidx.compose.foundation.layout.Box
Tff7b72import T7ee787androidx.compose.foundation.layout.fillMaxSize
Tff7b72import T7ee787androidx.compose.material3.SnackbarHost
Tff7b72import T7ee787androidx.compose.material3.SnackbarHostState
Tff7b72import T7ee787androidx.compose.material3.SnackbarResult
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.LaunchedEffect
Tff7b72import T7ee787androidx.compose.runtime.remember
Tff7b72import T7ee787androidx.compose.ui.Alignment
Tff7b72import T7ee787androidx.compose.ui.Modifier
Tff7b72import T7ee787org.meshtastic.core.ui.util.SnackbarManager
T8b949e/**
* Shared composable that observes [SnackbarManager.events] and provides a global [SnackbarHostState].
*
* It renders a [SnackbarHost] using the provided [hostModifier] over the provided [content].
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffMeshtasticSnackbarProviderTb4b4b4(
Te6edf3snackbarManagerTb4b4b4: Te6edf3SnackbarManagerTb4b4b4,
Te6edf3modifierTb4b4b4: Te6edf3Modifier Tff7b72= Te6edf3ModifierTb4b4b4,
Te6edf3hostModifierTb4b4b4: Te6edf3Modifier Tff7b72= Te6edf3ModifierTb4b4b4,
Te6edf3contentTb4b4b4: Tf0883e@Composable Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3snackbarHostState Tff7b72= Te6edf3remember Tb4b4b4{ Te6edf3SnackbarHostStateTb4b4b4(Tb4b4b4) Tb4b4b4}
Te6edf3LaunchedEffectTb4b4b4(Te6edf3snackbarManagerTb4b4b4) Tb4b4b4{
Te6edf3snackbarManagerTb4b4b4.Te6edf3eventsTb4b4b4.Te6edf3collect Tb4b4b4{ Te6edf3event Tff7b72-Tff7b72>
Tff7b72val Te6edf3result Tff7b72=
Te6edf3snackbarHostStateTb4b4b4.Te6edf3showSnackbarTb4b4b4(
Te6edf3message Tff7b72= Te6edf3eventTb4b4b4.Te6edf3messageTb4b4b4,
Te6edf3actionLabel Tff7b72= Te6edf3eventTb4b4b4.Te6edf3actionLabelTb4b4b4,
Te6edf3withDismissAction Tff7b72= Te6edf3eventTb4b4b4.Te6edf3withDismissActionTb4b4b4,
Te6edf3duration Tff7b72= Te6edf3eventTb4b4b4.Te6edf3durationTb4b4b4,
Tb4b4b4)
Tff7b72if Tb4b4b4(Te6edf3result Tff7b72=Tff7b72= Te6edf3SnackbarResultTb4b4b4.Te6edf3ActionPerformedTb4b4b4) Tb4b4b4{
Te6edf3eventTb4b4b4.Te6edf3onActionTff7b72?.Te6edf3invokeTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Te6edf3BoxTb4b4b4(Te6edf3modifier Tff7b72= Te6edf3modifierTb4b4b4.Te6edf3fillMaxSizeTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{
Te6edf3contentTb4b4b4(Tb4b4b4)
Te6edf3SnackbarHostTb4b4b4(
Te6edf3hostState Tff7b72= Te6edf3snackbarHostStateTb4b4b4,
Te6edf3modifier Tff7b72= Te6edf3ModifierTb4b4b4.Te6edf3alignTb4b4b4(Te6edf3AlignmentTb4b4b4.Te6edf3BottomCenterTb4b4b4)Tb4b4b4.Te6edf3thenTb4b4b4(Te6edf3hostModifierTb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s